{include file="common:meta" /}

<title>添加管理员 - 管理员管理 - TXCMS_V2</title>
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<article class="cl pd-20">
    <form action="" method="post" class="form form-horizontal form-group-adds" id="form-admin-add">
        <input type="hidden" name="id" value="{$data.id}">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>等级名称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" placeholder="请输入等级名称" value="{$data.level_name}" name="level_name">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>设置经验：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" placeholder="" value="{$data.exp}" name="exp">
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="button" id="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>
{include file="common:footer" /}
<script>
    $('#button').click(function () {
        var formData  = $('.form-group-adds').serialize();
        $.ajax({
            url:"{:url('level/level_update')}",
            type:'post',
            data:formData,
            success:function (res) {
                if(res.code === 0 ){
                    //失败
                    layer.msg(res.msg,{icon:2},300);
                }else{
                    //成功
                    layer.msg(res.msg,{icon:1},300);
                    var index1 = parent.layer.getFrameIndex(window.name);
                    setTimeout(function(){
                        parent.location.reload();
                        parent.layer.close(index1);//关闭弹出层
                    }, 2000);
                }
            }
        })
    })
</script>
</body>
</html>